#include "bodypart_rigid_sphere.h"

BodypartRigidSphere::BodypartRigidSphere(float rad, btDynamicsWorld* ownerWorld, void* owner, float weight, btVector3& localInertia, const btTransform& transform, const BeColor& clr, float lin_damping, float ang_damping)
  : BodypartRigid( SPHERE, clr, ownerWorld )
{
	shape = new btSphereShape( rad );

	generalSetup( localInertia, weight, transform, owner, lin_damping, ang_damping );

	radius = static_cast<btSphereShape*>(shape)->getRadius();
}

void BodypartRigidSphere::draw()
{
	glColor4f( color.r, color.g, color.b, color.a );
// 	myMotionState->m_graphicsWorldTrans.getOpenGLMatrix(position);
	glPushMatrix(); 
// 	glMultMatrixf(drawposition);
// 	glMultMatrixd(drawposition); // FIXME WATCHIT OK WENT TO DOUBLE HERE 
	Displaylists::Instance()->glMultiMatrix(drawposition);

		Displaylists::Instance()->drawSphere( radius, 12.56637 * radius / 12, 12.56637 * radius / 6 );

	glPopMatrix();
}

BodypartRigidSphere::~BodypartRigidSphere()
{
}
